package pixivPc.task;

import java.io.InputStream;

import pixivPc.http.RequestUtil;
import pixivPc.http.RequestUtil.SendType;
import pixivPc.ui.Panel;

public class LoginTask extends BaseTask {

	private static final String url = "https://accounts.pixiv.net/api/login?lang=ja";
	public static final String ref = "https://accounts.pixiv.net/login?lang=ja&source=pc&view_type=page&ref=wwwtop_accounts_index";

	public LoginTask(String pixivId, String pass, String postKey) {
		// {
		// 'mode': 'login',
		// 'pass': 'password',#用户密码
		// 'pixiv_id': 'username',#用户p站id或者邮箱
		// }
		// String param = ;
		super(url, ref,
				buildParam("pixiv_id", pixivId, "password", pass, "post_key", postKey, "ref", "wwwtop_accounts_index"),
				SendType.POST);
	}

	@Override
	protected void process(Panel panel, InputStream in) {
		// TODO Auto-generated method stub
		System.out.println(RequestUtil.readHtml(in));
	}

}
